﻿/*------------------------------------------------
// File Description: DistributeCode DataBase Entity
// Author:			 汪亮
// Create Time:		 2020-03-15 23:24:41
//------------------------------------------------*/

using System;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IOA.MES.DataAccess.Entity
{
    /// <summary>
    /// 分片条码
    /// </summary>
    [Table(nameof(DistributeCode))]
    public class DistributeCode : BaseEntity
    {
        private string _code = string.Empty;
        private string _orderNo;
        private string _workOrderNo;
        private string _ivCurrentLevel;
        private string _productCode;
        private string _productName;
        private string _workshopCode;
        private string _workshopName;
        private string _lineName;

        #region Public Property

        ///<Summary>
        /// 分片任务ID
        ///</Summary>
        public int DistributeTaskId { get; set; }

        ///<Summary>
        /// 流水线ID
        ///</Summary>
        public int LineId { get; set; }

        ///<Summary>
        /// 流水线名称
        ///</Summary>
        public string LineName
        {
            get { return string.IsNullOrWhiteSpace(_lineName) ? string.Empty : _lineName; }
            set { _lineName = value; }
        }

        ///<Summary>
        /// 条码
        ///</Summary>
        public string Code
        {
            get { return string.IsNullOrWhiteSpace(_code) ? string.Empty : _code; }
            set { _code = value; }
        }

        ///<Summary>
        /// 订单号
        ///</Summary>
        public string OrderNo
        {
            get { return string.IsNullOrWhiteSpace(_orderNo) ? string.Empty : _orderNo; }
            set { _orderNo = value; }
        }

        ///<Summary>
        /// 工单号
        ///</Summary>
        public string WorkOrderNo
        {
            get { return string.IsNullOrWhiteSpace(_workOrderNo) ? string.Empty : _workOrderNo; }
            set { _workOrderNo = value; }
        }

        ///<Summary>
        /// 车间代码
        ///</Summary>
        public string WorkshopCode
        {
            get { return string.IsNullOrWhiteSpace(_workshopCode) ? string.Empty : _workshopCode; }
            set { _workshopCode = value; }
        }

        ///<Summary>
        /// 车间名称
        ///</Summary>
        public string WorkshopName
        {
            get { return string.IsNullOrWhiteSpace(_workshopName) ? string.Empty : _workshopName; }
            set { _workshopName = value; }
        }

        ///<Summary>
        /// 料号
        ///</Summary>
        public string ProductCode
        {
            get { return string.IsNullOrWhiteSpace(_productCode) ? string.Empty : _productCode; }
            set { _productCode = value; }
        }

        ///<Summary>
        /// 物料名称
        ///</Summary>
        public string ProductName
        {
            get { return string.IsNullOrWhiteSpace(_productName) ? string.Empty : _productName; }
            set { _productName = value; }
        }

        ///<Summary>
        /// 状态
        ///</Summary>
        public Enum.DistributeCodeStatus Status { get; set; }
        #endregion
    }

    public partial class MESContext
    {
        /// <summary>
        /// 分片条码
        /// </summary>
        public virtual DbSet<DistributeCode> DistributeCodes { get; set; }
    }
}